/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('qssj', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model GetAgeDistributionRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  startDate?: string(name='StartDate'),
}

model GetAgeDistributionResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      ageRange?: string(name='AgeRange', example='26-30'),
      saleNumbers?: long(name='SaleNumbers', example='10'),
      searchNumbers?: long(name='SearchNumbers', example='10'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetAgeDistributionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAgeDistributionResponseBody(name='body'),
}

async function getAgeDistributionWithOptions(request: GetAgeDistributionRequest, runtime: Util.RuntimeOptions): GetAgeDistributionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cateIds)) {
    query['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    query['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgeDistribution',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAgeDistribution(request: GetAgeDistributionRequest): GetAgeDistributionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgeDistributionWithOptions(request, runtime);
}

model GetAllTrendCategoryResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      categoryId?: long(name='CategoryId', example='201241307'),
      categoryLevel?: int32(name='CategoryLevel', example='2'),
      categoryName?: string(name='CategoryName'),
      childCategory?: [ any ](name='ChildCategory'),
      superCategoryName?: string(name='SuperCategoryName'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetAllTrendCategoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllTrendCategoryResponseBody(name='body'),
}

async function getAllTrendCategoryWithOptions(runtime: Util.RuntimeOptions): GetAllTrendCategoryResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAllTrendCategory',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllTrendCategory(): GetAllTrendCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllTrendCategoryWithOptions(runtime);
}

model GetCrowdDataRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate', example='20220201'),
  pageIndex?: long(name='PageIndex', example='1'),
  startDate?: string(name='StartDate', example='20220101'),
}

model GetCrowdDataResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      age?: int32(name='Age', example='22'),
      buyerId?: long(name='BuyerId', example='555'),
      cateId?: long(name='CateId', example='1623'),
      cateName?: string(name='CateName'),
      classification?: string(name='Classification'),
      classificationNew?: string(name='ClassificationNew', example='“-1”'),
      gender?: string(name='Gender', example='“F”'),
      onlineDate?: string(name='OnlineDate', example='20220531'),
      orderAmount?: double(name='OrderAmount', example='4123.2'),
      orderQuantity?: long(name='OrderQuantity', example='421'),
      province?: string(name='Province'),
      searchVolume?: long(name='SearchVolume', example='61522'),
      trendLevel?: string(name='TrendLevel'),
    }
  ](name='Data'),
  message?: string(name='Message', example='“success”'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='“true”'),
}

model GetCrowdDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCrowdDataResponseBody(name='body'),
}

async function getCrowdDataWithOptions(request: GetCrowdDataRequest, runtime: Util.RuntimeOptions): GetCrowdDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetCrowdData',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCrowdData(request: GetCrowdDataRequest): GetCrowdDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCrowdDataWithOptions(request, runtime);
}

model GetCrowdLabelRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  startDate?: string(name='StartDate'),
}

model GetCrowdLabelResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      closingDate?: string(name='ClosingDate', example='20220518'),
      labelName?: string(name='LabelName'),
      orderAmount?: double(name='OrderAmount', example='51263.16'),
      purchaseAmount?: double(name='PurchaseAmount', example='591.33'),
      searchVolume?: double(name='SearchVolume', example='27036.0'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetCrowdLabelResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCrowdLabelResponseBody(name='body'),
}

async function getCrowdLabelWithOptions(request: GetCrowdLabelRequest, runtime: Util.RuntimeOptions): GetCrowdLabelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetCrowdLabel',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCrowdLabel(request: GetCrowdLabelRequest): GetCrowdLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCrowdLabelWithOptions(request, runtime);
}

model GetCrowdReginRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  startDate?: string(name='StartDate'),
}

model GetCrowdReginResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    saleNumbers?: [ 
      {
        name?: string(name='Name'),
        value?: long(name='Value', example='4709889'),
      }
    ](name='SaleNumbers'),
    searchNumbers?: [ 
      {
        name?: string(name='Name'),
        value?: long(name='Value', example='40578'),
      }
    ](name='SearchNumbers'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetCrowdReginResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCrowdReginResponseBody(name='body'),
}

async function getCrowdReginWithOptions(request: GetCrowdReginRequest, runtime: Util.RuntimeOptions): GetCrowdReginResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cateIds)) {
    query['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    query['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCrowdRegin',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCrowdRegin(request: GetCrowdReginRequest): GetCrowdReginResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCrowdReginWithOptions(request, runtime);
}

model GetOpportunityMarketRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  timeDisplay?: long(name='TimeDisplay', example='4'),
}

model GetOpportunityMarketResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      cateName?: string(name='CateName'),
      opportunityIndex?: double(name='OpportunityIndex', example='0.59'),
      relativeCommodity?: double(name='RelativeCommodity', example='0.99'),
      relativeDischarge?: double(name='RelativeDischarge', example='0.75'),
      timeUnit?: string(name='TimeUnit', example='202201'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetOpportunityMarketResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOpportunityMarketResponseBody(name='body'),
}

async function getOpportunityMarketWithOptions(request: GetOpportunityMarketRequest, runtime: Util.RuntimeOptions): GetOpportunityMarketResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.timeDisplay)) {
    body['TimeDisplay'] = request.timeDisplay;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetOpportunityMarket',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOpportunityMarket(request: GetOpportunityMarketRequest): GetOpportunityMarketResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOpportunityMarketWithOptions(request, runtime);
}

model GetPriceRangeRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  section?: long(name='Section'),
  shopIds?: string(name='ShopIds'),
  startDate?: string(name='StartDate'),
}

model GetPriceRangeResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      closingDate?: string(name='ClosingDate', example='20220518'),
      goodsSales?: long(name='GoodsSales', example='1092707'),
      priceRange?: string(name='PriceRange', example='0~100'),
      salesVolume?: double(name='SalesVolume', example='35840300.33'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetPriceRangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetPriceRangeResponseBody(name='body'),
}

async function getPriceRangeWithOptions(request: GetPriceRangeRequest, runtime: Util.RuntimeOptions): GetPriceRangeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.brandNames)) {
    body['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.section)) {
    body['Section'] = request.section;
  }
  if (!Util.isUnset(request.shopIds)) {
    body['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetPriceRange',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPriceRange(request: GetPriceRangeRequest): GetPriceRangeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPriceRangeWithOptions(request, runtime);
}

model GetSexRatioRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  startDate?: string(name='StartDate'),
}

model GetSexRatioResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    saleNumbers?: [ 
      {
        name?: string(name='Name', example='M'),
        value?: long(name='Value', example='2665206'),
      }
    ](name='SaleNumbers'),
    searchNumbers?: [ 
      {
        name?: string(name='Name', example='M'),
        value?: long(name='Value', example='45474'),
      }
    ](name='SearchNumbers'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetSexRatioResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSexRatioResponseBody(name='body'),
}

async function getSexRatioWithOptions(request: GetSexRatioRequest, runtime: Util.RuntimeOptions): GetSexRatioResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cateIds)) {
    query['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    query['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSexRatio',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSexRatio(request: GetSexRatioRequest): GetSexRatioResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSexRatioWithOptions(request, runtime);
}

model GetStoreSalesVolumeTopRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  endingPrice?: string(name='EndingPrice'),
  endingSalesVolume?: string(name='EndingSalesVolume'),
  pageIndex?: long(name='PageIndex'),
  shopIds?: string(name='ShopIds'),
  startDate?: string(name='StartDate'),
  startPrice?: string(name='StartPrice'),
  startSalesVolume?: string(name='StartSalesVolume'),
}

model GetStoreSalesVolumeTopResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      commodityQuantity?: long(name='CommodityQuantity'),
      salesVolume?: long(name='SalesVolume'),
      searchVolume?: long(name='SearchVolume'),
      shopId?: long(name='ShopId'),
      shopName?: string(name='ShopName'),
      totalSales?: double(name='TotalSales'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetStoreSalesVolumeTopResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStoreSalesVolumeTopResponseBody(name='body'),
}

async function getStoreSalesVolumeTopWithOptions(request: GetStoreSalesVolumeTopRequest, runtime: Util.RuntimeOptions): GetStoreSalesVolumeTopResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.brandNames)) {
    body['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.endingPrice)) {
    body['EndingPrice'] = request.endingPrice;
  }
  if (!Util.isUnset(request.endingSalesVolume)) {
    body['EndingSalesVolume'] = request.endingSalesVolume;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.shopIds)) {
    body['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.startPrice)) {
    body['StartPrice'] = request.startPrice;
  }
  if (!Util.isUnset(request.startSalesVolume)) {
    body['StartSalesVolume'] = request.startSalesVolume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetStoreSalesVolumeTop',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStoreSalesVolumeTop(request: GetStoreSalesVolumeTopRequest): GetStoreSalesVolumeTopResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStoreSalesVolumeTopWithOptions(request, runtime);
}

model GetStoreSearchTopRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  endingPrice?: string(name='EndingPrice'),
  endingSalesVolume?: string(name='EndingSalesVolume'),
  pageIndex?: long(name='PageIndex'),
  shopIds?: string(name='ShopIds'),
  startDate?: string(name='StartDate'),
  startPrice?: string(name='StartPrice'),
  startSalesVolume?: string(name='StartSalesVolume'),
}

model GetStoreSearchTopResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      commodityQuantity?: long(name='CommodityQuantity'),
      salesVolume?: long(name='SalesVolume'),
      searchVolume?: long(name='SearchVolume'),
      shopId?: long(name='ShopId'),
      shopName?: string(name='ShopName'),
      totalSales?: double(name='TotalSales'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetStoreSearchTopResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStoreSearchTopResponseBody(name='body'),
}

async function getStoreSearchTopWithOptions(request: GetStoreSearchTopRequest, runtime: Util.RuntimeOptions): GetStoreSearchTopResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.brandNames)) {
    body['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.endingPrice)) {
    body['EndingPrice'] = request.endingPrice;
  }
  if (!Util.isUnset(request.endingSalesVolume)) {
    body['EndingSalesVolume'] = request.endingSalesVolume;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.shopIds)) {
    body['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.startPrice)) {
    body['StartPrice'] = request.startPrice;
  }
  if (!Util.isUnset(request.startSalesVolume)) {
    body['StartSalesVolume'] = request.startSalesVolume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetStoreSearchTop',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStoreSearchTop(request: GetStoreSearchTopRequest): GetStoreSearchTopResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStoreSearchTopWithOptions(request, runtime);
}

model GetStyleOnlineRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate', example='20220201'),
  pageIndex?: long(name='PageIndex', example='1'),
  shopIds?: string(name='ShopIds', example='[571926]'),
  startDate?: string(name='StartDate', example='20220101'),
}

model GetStyleOnlineResponseBody = {
  code?: string(name='Code', example='"OK"'),
  data?: [ 
    {
      attributeContent?: string(name='AttributeContent'),
      brandName?: string(name='BrandName'),
      buyerTags?: string(name='BuyerTags'),
      cateName?: string(name='CateName'),
      color?: string(name='Color'),
      exposureValue?: long(name='ExposureValue', example='1379'),
      images?: [ string ](name='Images'),
      material?: string(name='Material'),
      price?: double(name='Price', example='464'),
      productLink?: string(name='ProductLink', example='"https://item.taobao.com/auction/noitem.htm?itemid=643170318769"'),
      sales?: double(name='Sales'),
      salesVolume?: long(name='SalesVolume', example='736'),
      searchVolume?: double(name='SearchVolume', example='13263'),
      shopId?: long(name='ShopId', example='5367123'),
      shopName?: string(name='ShopName'),
      style?: string(name='Style'),
      title?: string(name='Title'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetStyleOnlineResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStyleOnlineResponseBody(name='body'),
}

async function getStyleOnlineWithOptions(request: GetStyleOnlineRequest, runtime: Util.RuntimeOptions): GetStyleOnlineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.brandNames)) {
    query['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    query['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    query['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.shopIds)) {
    query['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetStyleOnline',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStyleOnline(request: GetStyleOnlineRequest): GetStyleOnlineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStyleOnlineWithOptions(request, runtime);
}

model GetStyleTopRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  endingPrice?: string(name='EndingPrice'),
  pageIndex?: long(name='PageIndex', example='1'),
  shopIds?: string(name='ShopIds'),
  sortOrder?: long(name='SortOrder', example='1'),
  startDate?: string(name='StartDate'),
  startPrice?: string(name='StartPrice'),
  timeDisplay?: long(name='TimeDisplay', example='6'),
}

model GetStyleTopResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      attributeContent?: string(name='AttributeContent'),
      brandName?: string(name='BrandName'),
      buyerTags?: string(name='BuyerTags'),
      cateName?: string(name='CateName'),
      color?: string(name='Color'),
      exposureValue?: long(name='ExposureValue'),
      images?: [ string ](name='Images'),
      material?: string(name='Material'),
      price?: double(name='Price'),
      productLink?: string(name='ProductLink', example='"https://item.taobao.com/auction/noitem.htm?itemid=643170318769"'),
      sales?: double(name='Sales'),
      salesVolume?: long(name='SalesVolume', example='736'),
      searchVolume?: double(name='SearchVolume', example='13263'),
      shopId?: long(name='ShopId'),
      shopName?: string(name='ShopName'),
      style?: string(name='Style'),
      title?: string(name='Title'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='true'),
}

model GetStyleTopResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStyleTopResponseBody(name='body'),
}

async function getStyleTopWithOptions(request: GetStyleTopRequest, runtime: Util.RuntimeOptions): GetStyleTopResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.brandNames)) {
    body['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.endingPrice)) {
    body['EndingPrice'] = request.endingPrice;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.shopIds)) {
    body['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.sortOrder)) {
    body['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.startPrice)) {
    body['StartPrice'] = request.startPrice;
  }
  if (!Util.isUnset(request.timeDisplay)) {
    body['TimeDisplay'] = request.timeDisplay;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetStyleTop',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStyleTop(request: GetStyleTopRequest): GetStyleTopResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStyleTopWithOptions(request, runtime);
}

model GetTrendImageDetailRequest {
  aiImgId?: string(name='AiImgId', example='[f93f34271c93c026aba75ca1b9f9fd2b]'),
}

model GetTrendImageDetailResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    aiImgId?: string(name='AiImgId', example='f93f34271c93c026aba75ca1b9f9fd2b'),
    aiImgUrl?: string(name='AiImgUrl'),
    multiPictUrl?: string(name='MultiPictUrl'),
    population?: string(name='Population', example='-1'),
    priceMax?: long(name='PriceMax'),
    priceMin?: long(name='PriceMin'),
    similarGoods?: [ 
      {
        aiImgUrl?: string(name='AiImgUrl', example='"https://img.alicdn.com/imgextra/O1CN01hmx9pJ2MhTW9iEJd9_!!2638679859.jpg"'),
        goodsSales?: long(name='GoodsSales', example='-1'),
        searchVolume?: long(name='SearchVolume', example='-1'),
      }
    ](name='SimilarGoods'),
    tags?: string(name='Tags'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetTrendImageDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendImageDetailResponseBody(name='body'),
}

async function getTrendImageDetailWithOptions(request: GetTrendImageDetailRequest, runtime: Util.RuntimeOptions): GetTrendImageDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aiImgId)) {
    query['AiImgId'] = request.aiImgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendImageDetail',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendImageDetail(request: GetTrendImageDetailRequest): GetTrendImageDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendImageDetailWithOptions(request, runtime);
}

model GetTrendImageListRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  query?: string(name='Query'),
}

model GetTrendImageListResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      aiImgId?: string(name='AiImgId', example='f93f34271c93c026aba75ca1b9f9fd2b'),
      aiImgUrl?: string(name='AiImgUrl'),
      population?: string(name='Population'),
      priceMax?: long(name='PriceMax'),
      priceMin?: long(name='PriceMin'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetTrendImageListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendImageListResponseBody(name='body'),
}

async function getTrendImageListWithOptions(request: GetTrendImageListRequest, runtime: Util.RuntimeOptions): GetTrendImageListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.query)) {
    body['Query'] = request.query;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendImageList',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendImageList(request: GetTrendImageListRequest): GetTrendImageListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendImageListWithOptions(request, runtime);
}

model GetTrendIndexRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  monthNum?: int32(name='MonthNum', example='1'),
}

model GetTrendIndexResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      brandIndex?: float(name='BrandIndex', example='0.80329525'),
      ECommerceIndex?: float(name='ECommerceIndex', example='4.5877037'),
      institutionalIndex?: float(name='InstitutionalIndex', example='0.81578285'),
      mediaIndex?: float(name='MediaIndex', example='0.80389094'),
      socialIndex?: float(name='SocialIndex', example='0.84380144'),
      trendIndex?: float(name='TrendIndex'),
      yearMonth?: string(name='YearMonth', example='202111'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetTrendIndexResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendIndexResponseBody(name='body'),
}

async function getTrendIndexWithOptions(request: GetTrendIndexRequest, runtime: Util.RuntimeOptions): GetTrendIndexResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.monthNum)) {
    body['MonthNum'] = request.monthNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendIndex',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendIndex(request: GetTrendIndexRequest): GetTrendIndexResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendIndexWithOptions(request, runtime);
}

model GetTrendSearchRecordRequest {
  key?: string(name='Key'),
}

model GetTrendSearchRecordResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      id?: long(name='Id'),
      queryKey?: string(name='QueryKey'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetTrendSearchRecordResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendSearchRecordResponseBody(name='body'),
}

async function getTrendSearchRecordWithOptions(request: GetTrendSearchRecordRequest, runtime: Util.RuntimeOptions): GetTrendSearchRecordResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendSearchRecord',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendSearchRecord(request: GetTrendSearchRecordRequest): GetTrendSearchRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendSearchRecordWithOptions(request, runtime);
}

model GetTrendStatisticRequest {
  brandNames?: string(name='BrandNames'),
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate'),
  shopIds?: string(name='ShopIds'),
  startDate?: string(name='StartDate'),
}

model GetTrendStatisticResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    brandCount?: long(name='BrandCount'),
    commodityCount?: long(name='CommodityCount', example='66417189'),
    exposureValue?: long(name='ExposureValue'),
    hits?: long(name='Hits'),
    sales?: double(name='Sales', example='3145796461.2734184'),
    salesVolume?: long(name='SalesVolume'),
    shopCount?: long(name='ShopCount', example='1936264'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: boolean(name='SuccessResponse', example='true'),
}

model GetTrendStatisticResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendStatisticResponseBody(name='body'),
}

async function getTrendStatisticWithOptions(request: GetTrendStatisticRequest, runtime: Util.RuntimeOptions): GetTrendStatisticResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.brandNames)) {
    body['BrandNames'] = request.brandNames;
  }
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.shopIds)) {
    body['ShopIds'] = request.shopIds;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendStatistic',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendStatistic(request: GetTrendStatisticRequest): GetTrendStatisticResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendStatisticWithOptions(request, runtime);
}

model GetTrendWordAndIndexRequest {
  cateIds?: string(name='CateIds', example='[1623]'),
  endingDate?: string(name='EndingDate', example='202202'),
  pageIndex?: long(name='PageIndex', example='1'),
  startDate?: string(name='StartDate', example='202201'),
}

model GetTrendWordAndIndexResponseBody = {
  code?: string(name='Code', example='"OK"'),
  data?: [ 
    {
      brandIndex?: float(name='BrandIndex', example='1.0023898331'),
      cateId?: long(name='CateId', example='1623'),
      cateName?: string(name='CateName'),
      ecommerceIndex?: float(name='EcommerceIndex', example='1.236972369'),
      institutionalIndex?: float(name='InstitutionalIndex', example='0.438129369'),
      mediaIndex?: float(name='MediaIndex', example='0.9732739173'),
      socialIndex?: float(name='SocialIndex', example='1.6200038123'),
      trendIndex?: float(name='TrendIndex', example='1.000000730'),
      trendWord?: string(name='TrendWord'),
      yearMonth?: string(name='YearMonth', example='"202205"'),
    }
  ](name='Data'),
  massage?: string(name='Massage', example='“success”'),
  requestId?: string(name='RequestId', example='33d70ec3-6bbe-47b7-9c23-cd31075ddc1f'),
  successResponse?: string(name='SuccessResponse', example='“true”'),
}

model GetTrendWordAndIndexResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrendWordAndIndexResponseBody(name='body'),
}

async function getTrendWordAndIndexWithOptions(request: GetTrendWordAndIndexRequest, runtime: Util.RuntimeOptions): GetTrendWordAndIndexResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cateIds)) {
    body['CateIds'] = request.cateIds;
  }
  if (!Util.isUnset(request.endingDate)) {
    body['EndingDate'] = request.endingDate;
  }
  if (!Util.isUnset(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTrendWordAndIndex',
    version = '2022-01-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrendWordAndIndex(request: GetTrendWordAndIndexRequest): GetTrendWordAndIndexResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrendWordAndIndexWithOptions(request, runtime);
}

